<? include "./pc/view/header.inc.htm"; ?>
<div class="panel_body margin">
	<dl class="row" pid="<?=$first['pid']?>" id="firstpost">
		<dt class="vtop">
			<a href="<?=$thread['user_url']?>" class="author">
				<img src="<?=$thread['user_avatar_url']?>" class="avatar big" />
			</a>
		</dt>
		<dd>
			<h3 class="nospace subject breakall bold" pid="<?=$first['pid']?>"><?=$thread['subject']?></h3>
			<dl class="row">
				<dt class="left small">
					<b class="light"><a href="<?=$thread['user_url']?>"><?=$thread['username']?></a></b>　
					<i class="light"><?=$thread['create_date_fmt']?></i>
				</dt>
				<dd class="right grey">

				<? if($allowupdate || $first['allowupdate']) { ?>
					<a href="post-update-<?=$first['pid']?>.htm" class="nocache" title="编辑"><i class="icon edit"></i></a>
				<? } ?>
				
				<? if($allowdelete || $first['allowdelete']) { ?>
					<a href="post-delete-<?=$first['pid']?>.htm" class="delete" title="删除"><i class="icon trash-o"></i></a>
				　<? } ?>
					<i class="icon agree" title="赞同" tabindex="0" role="button"></i>
					<i class="icon agreed" title="取消赞同" style="display: none;" tabindex="0" role="button"></i>
					<a href="agree-list-<?=$first['pid']?>.htm" class="ajax dialog nocache icon agrees <?=$thread['agrees_class']?>" dialog='{"modal":false,"position":4}' nofollow><?=$first['agrees']?></a>
				</dd>
			</dl>
		</dd>
	</dl>
	
	<div id="thread_post" class="thread_post" pid="<?=$thread['firstpid']?>">
		<?=$first['message']?>
		
		<? if($imagelist || $filelist) { ?>
		<br>
		<p class="margin">附件列表：</p>
		<p class="hr"></p>
		<ul>
		<? foreach ($imagelist as $attach) { ?>
			<li><a href="upload/attach/<?=$attach['filename']?>" target="_blank"><img src="upload/attach/<?=$attach['filename']?>" width="<?=$attach['width']?>" height="<?=$attach['height']?>" /></a></li>
		<? } ?>
		<? foreach ($filelist as $attach) { ?>
			<li><i class="icon filetype <?=$attach['filetype']?> small"></i> <a href="upload/attach/<?=$attach['filename']?>" target="_blank"><?=$attach['orgfilename']?></a></li>
		<? } ?>
		</ul>
		<? } ?>
	</div>
	
<? if($thread['posts'] > 0) { ?>

	<div id="postlist_title">
		<span class="active grey" style="cursor:pointer">回复</span> 
		<span id="posts" class="posts <?=$thread['posts_class']?>"><?=$thread['posts']?></span> &nbsp; 
		<span class="grey" style="cursor:pointer">只看赞同</span> 
	</div>
	
<? } else {?>

	<div id="postlist_title" style="border: 0px;"></div>
	
<? } ?>
	
	<div id="postlist">
		<? include './pc/view/post_list_body.inc.htm';?>
	</div>
	
	<dl class="row vtop margin" id="post_create_dl">
		<dt>
			<img src="<?=$user['avatar_url']?>" class="avatar" />
		</dd>
		<dd>
			<dl class="row">
				<dt class="left small">
					<b class="light"><?=$user['username']?></b>　
					<i class="light">现在</i>
				</dt>
				<dd class="right">
				</dd>
			</dl>
			<div class="post">
				<form id="quick_post_form" action="post-create-<?=$tid?>-quick.htm" method="post">
					<textarea style="width: 100%; height: 100px;" name="message"></textarea>
					<dl class="row margin">
						<dt class="vbottom">
							
							<button type="submit" loading-text="正在提交..." class="grey small">回帖</button>
							　
							<label class="grey small" id="agree_thread_label"><input type="checkbox" name="agree" value="1" /><i class="icon agreed" style="display:none;"></i>赞同楼主</label>
							
						</dt>
						<dd class="right">
							<a href="post-create-<?=$tid?>.htm" target="_blank"><i class="icon share">编辑器</i></a>
						</dd>
					</dl>
				</form>
			</div>
		</dd>
	</dl>
		
</div>

<br>
<p class="center margin"><button class="big grey" onclick="history.back();">  &nbsp;返回&nbsp; </button></p>
<br>

<script id="script_data">
var new_thread_days = <?=$conf['new_thread_days']?>;
var allowpost = <?=$allowpost?>;
var tid = <?=$tid?>;
var thread = <?=xn_json_encode($thread)?>;
</script>

<? include "./pc/view/footer.inc.htm"; ?>

<script>
render_threadlist();
post_list_script(fid);
forumlist_active(fid);
document_scroll_top();
</script>

<script type="text/javascript" src="plugin/xn_syntax_highlighter/syntaxhighlighter_3.0.83/scripts/shCore.js"></script>
<script type="text/javascript" src="plugin/xn_syntax_highlighter/syntaxhighlighter_3.0.83/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="plugin/xn_syntax_highlighter/syntaxhighlighter_3.0.83/scripts/shBrushPhp.js"></script>
<script type="text/javascript" src="plugin/xn_syntax_highlighter/syntaxhighlighter_3.0.83/scripts/shBrushJava.js"></script>
<script type="text/javascript" src="plugin/xn_syntax_highlighter/syntaxhighlighter_3.0.83/scripts/shBrushCpp.js"></script>
<link type="text/css" rel="stylesheet" href="plugin/xn_syntax_highlighter/syntaxhighlighter_3.0.83/styles/shCoreDefault.css"/>
<link type="text/css" rel="stylesheet" href="plugin/xn_syntax_highlighter/syntaxhighlighter_3.0.83/styles/shCoreDefault.css"/>
<script type="text/javascript">SyntaxHighlighter.all();</script>
